/**
 *
 */
package com.angel.mocks.factories;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.commons.lang.RandomStringUtils;

import com.angel.architecture.persistence.beans.ConfigurationParameter;

/**
 * @author William
 *
 */
public class ConfigurationParameterFactory {

	private ConfigurationParameterFactory(){
		super();
	}

	public static ConfigurationParameter createEmptyConfigurationParameter(){
		return new ConfigurationParameter();
	}

	public static ConfigurationParameter createConfigurationParameter(){
		ConfigurationParameter configurationParameter = createEmptyConfigurationParameter();
		configurationParameter.setStringValue(RandomStringUtils.randomAlphabetic(15));
		configurationParameter.setDescription(RandomStringUtils.randomAlphabetic(25));
		configurationParameter.setName(RandomStringUtils.randomAlphabetic(20));
		configurationParameter.setMaximumValue(RandomStringUtils.randomNumeric(5));
		configurationParameter.setMinimumValue(RandomStringUtils.randomNumeric(1));
		return configurationParameter;
	}

	public static Collection<ConfigurationParameter> createConfigurationParameter(int quantity){
		List<ConfigurationParameter> configurationParameters = new ArrayList<ConfigurationParameter>();
		for(int i = 0; i < quantity; i++){
			configurationParameters.add(createConfigurationParameter());
		}
		return configurationParameters;
	}
}
